#include <gtest/gtest.h>
#include <nlohmann/json.hpp>

#include "Utility/Configuration/SGConfig.h"

using json = nlohmann::json;

class SGConfigDataTest
{
  public:
    // 测试数据模块路径
    std::string TestDataRootPath = "../../../TestData";

    NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT (SGConfigDataTest, TestDataRootPath)
};

TEST (ConfigTest, to_json)
{
    SGConfigDataTest test;
    json             j;
    to_json (j, test);
}

TEST (ConfigTest, Empty)
{
    auto config = SG::Utility::SGConfig::GetInstance ().GetData ();

    ASSERT_EQ (config.Has ("Post"), true);
    ASSERT_EQ (config.GetValue("Post").GetValue("DrawDeformed").GetBool(), false);
}
